/*
 * TelaRanking.java
 *
 * Created on 28 de Março de 2009, 17:30
 */

package iu;

import comp.racer.common.rn.Jogador;
import java.util.List;
import javax.swing.JTable;

/**
 *
 * @author  Germano
 */
public class RankingTela extends JogadorTableHolder {

    /** Creates new form TelaRanking */
    public RankingTela(List<Jogador> classificacao) {
        setClassificacao(classificacao);
        initComponents();
        updateComponents();
        exibeTela();
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbRanking = new javax.swing.JLabel();
        voltarBt = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTClassificacao = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("CompRacer - Ranking");

        lbRanking.setText("Ranking");

        voltarBt.setText("Voltar");
        voltarBt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voltarBtActionPerformed(evt);
            }
        });

        jTClassificacao.setModel(new javax.swing.table.DefaultTableModel());
        jScrollPane1.setViewportView(jTClassificacao);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(117, 117, 117)
                        .addComponent(lbRanking))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(148, 148, 148)
                        .addComponent(voltarBt)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbRanking)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(47, 47, 47)
                .addComponent(voltarBt)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void voltarBtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_voltarBtActionPerformed
       this.dispose();
       this.setVisible(false);
       
    }//GEN-LAST:event_voltarBtActionPerformed

    /**
    * @param args the command line arguments
    */
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTClassificacao;
    private javax.swing.JLabel lbRanking;
    private javax.swing.JButton voltarBt;
    // End of variables declaration//GEN-END:variables

    public JTable getJtClassificacao() {
        return jTClassificacao;
    }

    public void setJtClassificacao(JTable jTClassificacao) {
        this.jTClassificacao = jTClassificacao;
    }

  

}
